<template>
	<view class="page my">
		<view>
			<view class="xc-w-100p xc-margin-b-10 hy-bg xc-relative" style="height: calc( 100vw / 1.88 );">
				<view class="xc-c-fff">
					<cu-custom bgColor="" :isBack="true">
						<block slot="content"><text class="xc-text-16"></text></block>
						<block slot="right">
							<view class="xc-h-100p" @click="goRoute('nt','/pages/my/user_info')">
								<text class="xc-text-16 xc-w-40 xc-h-100p xc-padding-r-15 flex align-center justify-end cuIcon-settings xc-c-fff"></text>
							</view>
						</block>
					</cu-custom>
				</view>
				<view class="flex xc-absolute xc-padding-l-15 flex align-center" style="top: 45%;transform: translateY(-50%);">
					<view class="xc-margin-r-15">
						<image class="xc-w-60 xc-h-60 xc-radius-1000" src="/static/index/P12.png" mode=""></image>
					</view>
					<view>
						<view class="xc-text-17 xc-c-fff xc-text-bold" style="opacity: 0.9;">名称</view>
						<view class="xc-c-fff xc-margin-t-5 xc-text-12" style="opacity: 0.8;">邀请码：123456</view>
					</view>
				</view>

				<view class="xc-absolute flex xc-w-100p align-center justify-between xc-padding-l-40 xc-padding-r-30" style="bottom: 4%;">
					<view class="xc-text-15" style="color: #8E7D4D;">加盟合伙人享更多权益</view>
					<view class="xc-bg-666 xc-radius-1000 xc-padding-tb-5 xc-padding-lr-10" style="color: #FEEDC7;">立即申请</view>
				</view>
			</view>

			<!-- 余额/收藏 -->
			<view class="xc-margin-b-10 xc-padding-lr-10">
				<view class="xc-w-100p xc-h-80 flex justify-between xc-bg-fff xc-radius-10">
					<view @click="goRoute('nt','/pages/my/money_bag')" class="xc-w-3333p xc-h-100p flex align-center justify-center flex-direction">
						<view class="xc-c-000 xc-text-16">0</view>
						<view class="xc-c-888 xc-margin-t-5">总余额</view>
					</view>
					<view @click="goRoute('nt','/pages/my/coupon_list')" class="xc-w-3333p xc-h-100p flex align-center justify-center flex-direction">
						<view class="xc-c-000 xc-text-16">0</view>
						<view class="xc-c-888 xc-margin-t-5">优惠券</view>
					</view>
					<view class="xc-w-3333p xc-h-100p flex align-center justify-center flex-direction">
						<view class="xc-c-000 xc-text-16">0</view>
						<view class="xc-c-888 xc-margin-t-5">已收藏</view>
					</view>
				</view>
			</view>

			<!-- 我的订单 -->
			<view class="xc-padding-lr-10 xc-margin-b-10">
				<navigator url="order_list" class="cu-bar bg-white solid-bottom" style="border-top-left-radius:10rpx;border-top-right-radius:10rpx;">
					<view class="action">我的订单</view>
					<view class="action text-sm xc-c-999">查看全部<text class="cuIcon-right xc-c-999" style="font-size: 28rpx;"></text>
					</view>

				</navigator>
				<view class="cu-list grid col-4 no-border" style="border-bottom-left-radius:10rpx;border-bottom-right-radius:10rpx;">
					<view class="cu-item" @tap="navTo(item.url)" v-for="(item,index) in orderNav" :key="index">
						<view>
							<image :src="item.icon" class="xc-w-25 xc-h-25" mode=""></image>
							<view class="cu-tag badge" v-if="item.num!=0">
								<block v-if="item.num!=0">{{item.num>99?'99+':item.num}}</block>
							</view>
						</view>
						<text>{{item.label}}</text>
					</view>

				</view>
			</view>

			<!-- 我的订单 -->
			<view class="xc-padding-lr-10 xc-margin-b-10">
				<navigator url="order_list" class="cu-bar bg-white solid-bottom" style="border-top-left-radius:10rpx;border-top-right-radius:10rpx;">
					<view class="action">我的收益</view>
					<view class="action text-sm xc-c-999">查看全部<text class="cuIcon-right xc-c-999" style="font-size: 28rpx;"></text>
					</view>

				</navigator>

				<view class="xc-margin-b-10">
					<view class="xc-w-100p xc-h-80 flex justify-between xc-bg-fff" style="border-bottom-left-radius:10rpx;border-bottom-right-radius:10rpx;">
						<view class="xc-w-50p xc-h-100p flex align-center justify-center flex-direction">
							<view class="xc-text-16" style="color: #FF4A4E;">0</view>
							<view class="xc-c-888 xc-margin-t-5">累计现金奖励(元)</view>
						</view>
						<view class="xc-w-50p xc-h-100p flex align-center justify-center flex-direction">
							<view class="xc-text-16" style="color: #FF4A4E;">0</view>
							<view class="xc-c-888 xc-margin-t-5">累计种子奖励(颗)</view>
						</view>
					</view>
				</view>
			</view>

			<!-- banner -->
			<view class="xc-padding-lr-10 xc-margin-b-10">
				<image class="xc-w-100p" src="/static/img/yqhy.png" mode="" style="height: calc(100vw / 4.38);"></image>
			</view>

			<view class="xc-padding-lr-10 xc-margin-b-50">
				<view class="cu-list grid col-4 no-border" style="border-bottom-left-radius:10rpx;border-bottom-right-radius:10rpx;">
					<view class="cu-item" style="padding-top: 20rpx;" @tap="navTo(item.url)" v-for="(item,index) in ftNav" :key="index">
						<view>
							<image :src="item.icon" class="xc-w-35 xc-h-35" mode=""></image>
							<view class="cu-tag badge" v-if="item.num!=0">
								<block v-if="item.num!=0">{{item.num>99?'99+':item.num}}</block>
							</view>
						</view>
						<text>{{item.label}}</text>
					</view>
				</view>
			</view>


			<!-- 导航链接 -->
			<!-- <view class="cu-list menu sm-border">
    			
    			<view class="cu-item arrow"  @tap="navTo('user_info')">
    				<view class="content">
    					<text class="cuIcon-profilefill text-olive"></text>
    					<text class="text-grey">我的资料</text>
    				</view>
    			</view> -->
			<!-- 	<view class="cu-item arrow">
    				<view class="content">
    					<text class="cuIcon-favorfill text-pink"></text>
    					<text class="text-grey">我的收藏</text>
    				</view>
    			</view> -->
			<!-- <view class="cu-item arrow" @tap="navTo('money_bag')">
    				<view class="content">
    					<text class="cuIcon-moneybag text-orange"></text>
    					<text class="text-grey">我的钱包</text>
    				</view>
    			</view>
    			 <view class="cu-item arrow" @tap="navTo('coupon_list')">
    				<view class="content">
    					<text class="cuIcon-card text-orange"></text>
    					<text class="text-grey">优惠券</text>
    				</view>
    			</view>
    			<view class="cu-item arrow" @tap="navTo('address_list')">
    				<view class="content">
    					<text class="cuIcon-deliver_fill text-brown"></text>
    					<text class="text-grey">收货地址</text>
    				</view>
    			</view>
    			<view class="cu-item arrow" @tap="telTo">
    				<view class="content">
    					<text class="cuIcon-servicefill text-red"></text>
    					<text class="text-grey">客服反馈</text>
    				</view>
    			</view>
    		</view>
    		
    		<view class="cu-list menu sm-border">
    			<view class="cu-item arrow" @tap="navTo('../setting/index')">
    				<view class="content">
    					<text class="lg cuIcon-repairfill text-yellow"></text>
    					<text class="text-grey">系统设置</text>
    				</view>
    			</view>
    			<view class="cu-item arrow" @tap="navTo('../passport/forget?mobile='+ userInfo.mobile)">
    				<view class="content">
    					<text class="cuIcon-lock text-cyan"></text>
    					<text class="text-grey">修改密码</text>
    				</view>
    			</view>
    			
    		</view> -->

			<!-- 注销退出	 -->
			<!-- <view class="padding flex flex-direction">
    			<button @tap="gotoLogout" class="cu-btn bg-gradual-green margin-tb-sm lg">注销退出</button>
    		</view> -->
			<view class="cu-tabbar-height"></view>
		</view>

	</view>
</template>

<script>
	export default {
		name: "my",
		data() {
			return {
				normalScrollView: {},
				orderNav: [{
						icon: "/static/img/ico-dfk.png",
						label: "待付款",
						num: 0,
						status: 0,
						url: "order_list?status=0"
					},
					{
						icon: "/static/img/ico-dfh.png",
						label: "待发货",
						num: 0,
						status: 1,
						url: "order_list?status=1"
					},
					{
						icon: "/static/img/ico-dsh.png",
						label: "待收货",
						num: 0,
						status: 2,
						url: "order_list?status=2"
					},
					{
						icon: "/static/img/ico-sh.png",
						label: "待评价",
						num: 0,
						status: 8,
						url: "order_list?status=3"
					}
				],
				ftNav: [{
						icon: "/static/img/ico-xxgl@2x.png",
						label: "信息管理",
						num: 0,
						status: 8,
						url: "/pages/my/user_info"
					},
					{
						icon: "/static/img/ico-shdz@2x.png",
						label: "收货地址",
						num: 0,
						status: 8,
						url: "/pages/my/address_add"
					},
					{
						icon: "/static/img/ico-yhk@2x.png",
						label: "银行卡",
						num: 0,
						status: 8,
						url: "/pages/my/money_bag"
					},
					{
						icon: "/static/img/ico-jmsq@2x.png",
						label: "加盟申请",
						num: 0,
						status: 8,
						url: ""
					},
					{
						icon: "/static/img/ico-zxkf@2x.png",
						label: "在线客服",
						num: 0,
						status: 8,
						url: ""
					},
					{
						icon: "/static/img/ico-zd@2x.png",
						label: "账单",
						num: 0,
						status: 8,
						url: ""
					},
					{
						icon: "/static/img/ico-fqpt@2x.png",
						label: "发起拼团",
						num: 0,
						status: 8,
						url: ""
					},
					{
						icon: "/static/img/ico-js.png",
						label: "寄售",
						num: 0,
						status: 8,
						url: ""
					},
				],
				templateAll:`
				<template>
					<view class="page my">
						<view>
							<view class="xc-w-100p xc-margin-b-10 hy-bg xc-relative" style="height: calc( 100vw / 1.88 );">
								<view class="xc-c-fff">
									<cu-custom bgColor="" :isBack="true">
										<block slot="content"><text class="xc-text-16"></text></block>
										<block slot="right">
											<view class="xc-h-100p" @click="goRoute('nt','/pages/my/user_info')">
												<text class="xc-text-16 xc-w-40 xc-h-100p xc-padding-r-15 flex align-center justify-end cuIcon-settings xc-c-fff"></text>
											</view>
										</block>
									</cu-custom>
								</view>
								<view class="flex xc-absolute xc-padding-l-15 flex align-center" style="top: 45%;transform: translateY(-50%);">
									<view class="xc-margin-r-15">
										<image class="xc-w-60 xc-h-60 xc-radius-1000" src="/static/index/P12.png" mode=""></image>
									</view>
									<view>
										<view class="xc-text-17 xc-c-fff xc-text-bold" style="opacity: 0.9;">名称</view>
										<view class="xc-c-fff xc-margin-t-5 xc-text-12" style="opacity: 0.8;">邀请码：123456</view>
									</view>
								</view>
				
								<view class="xc-absolute flex xc-w-100p align-center justify-between xc-padding-l-40 xc-padding-r-30" style="bottom: 4%;">
									<view class="xc-text-15" style="color: #8E7D4D;">加盟合伙人享更多权益</view>
									<view class="xc-bg-666 xc-radius-1000 xc-padding-tb-5 xc-padding-lr-10" style="color: #FEEDC7;">立即申请</view>
								</view>
							</view>
				
							<!-- 余额/收藏 -->
							<view class="xc-margin-b-10 xc-padding-lr-10">
								<view class="xc-w-100p xc-h-80 flex justify-between xc-bg-fff xc-radius-10">
									<view @click="goRoute('nt','/pages/my/money_bag')" class="xc-w-3333p xc-h-100p flex align-center justify-center flex-direction">
										<view class="xc-c-000 xc-text-16">0</view>
										<view class="xc-c-888 xc-margin-t-5">总余额</view>
									</view>
									<view @click="goRoute('nt','/pages/my/coupon_list')" class="xc-w-3333p xc-h-100p flex align-center justify-center flex-direction">
										<view class="xc-c-000 xc-text-16">0</view>
										<view class="xc-c-888 xc-margin-t-5">优惠券</view>
									</view>
									<view class="xc-w-3333p xc-h-100p flex align-center justify-center flex-direction">
										<view class="xc-c-000 xc-text-16">0</view>
										<view class="xc-c-888 xc-margin-t-5">已收藏</view>
									</view>
								</view>
							</view>
				
							<!-- 我的订单 -->
							<view class="xc-padding-lr-10 xc-margin-b-10">
								<navigator url="order_list" class="cu-bar bg-white solid-bottom" style="border-top-left-radius:10rpx;border-top-right-radius:10rpx;">
									<view class="action">我的订单</view>
									<view class="action text-sm xc-c-999">查看全部<text class="cuIcon-right xc-c-999" style="font-size: 28rpx;"></text>
									</view>
				
								</navigator>
								<view class="cu-list grid col-4 no-border" style="border-bottom-left-radius:10rpx;border-bottom-right-radius:10rpx;">
									<view class="cu-item" @tap="navTo(item.url)" v-for="(item,index) in orderNav" :key="index">
										<view>
											<image :src="item.icon" class="xc-w-25 xc-h-25" mode=""></image>
											<view class="cu-tag badge" v-if="item.num!=0">
												<block v-if="item.num!=0">{{item.num>99?'99+':item.num}}</block>
											</view>
										</view>
										<text>{{item.label}}</text>
									</view>
				
								</view>
							</view>
				
							<!-- 我的订单 -->
							<view class="xc-padding-lr-10 xc-margin-b-10">
								<navigator url="order_list" class="cu-bar bg-white solid-bottom" style="border-top-left-radius:10rpx;border-top-right-radius:10rpx;">
									<view class="action">我的收益</view>
									<view class="action text-sm xc-c-999">查看全部<text class="cuIcon-right xc-c-999" style="font-size: 28rpx;"></text>
									</view>
				
								</navigator>
				
								<view class="xc-margin-b-10">
									<view class="xc-w-100p xc-h-80 flex justify-between xc-bg-fff" style="border-bottom-left-radius:10rpx;border-bottom-right-radius:10rpx;">
										<view class="xc-w-50p xc-h-100p flex align-center justify-center flex-direction">
											<view class="xc-text-16" style="color: #FF4A4E;">0</view>
											<view class="xc-c-888 xc-margin-t-5">累计现金奖励(元)</view>
										</view>
										<view class="xc-w-50p xc-h-100p flex align-center justify-center flex-direction">
											<view class="xc-text-16" style="color: #FF4A4E;">0</view>
											<view class="xc-c-888 xc-margin-t-5">累计种子奖励(颗)</view>
										</view>
									</view>
								</view>
							</view>
				
							<!-- banner -->
							<view class="xc-padding-lr-10 xc-margin-b-10">
								<image class="xc-w-100p" src="/static/img/yqhy.png" mode="" style="height: calc(100vw / 4.38);"></image>
							</view>
				
							<view class="xc-padding-lr-10 xc-margin-b-50">
								<view class="cu-list grid col-4 no-border" style="border-bottom-left-radius:10rpx;border-bottom-right-radius:10rpx;">
									<view class="cu-item" style="padding-top: 20rpx;" @tap="navTo(item.url)" v-for="(item,index) in ftNav" :key="index">
										<view>
											<image :src="item.icon" class="xc-w-35 xc-h-35" mode=""></image>
											<view class="cu-tag badge" v-if="item.num!=0">
												<block v-if="item.num!=0">{{item.num>99?'99+':item.num}}</block>
											</view>
										</view>
										<text>{{item.label}}</text>
									</view>
								</view>
							</view>
				
				
							<!-- 导航链接 -->
							<!-- <view class="cu-list menu sm-border">
				    			
				    			<view class="cu-item arrow"  @tap="navTo('user_info')">
				    				<view class="content">
				    					<text class="cuIcon-profilefill text-olive"></text>
				    					<text class="text-grey">我的资料</text>
				    				</view>
				    			</view> -->
							<!-- 	<view class="cu-item arrow">
				    				<view class="content">
				    					<text class="cuIcon-favorfill text-pink"></text>
				    					<text class="text-grey">我的收藏</text>
				    				</view>
				    			</view> -->
							<!-- <view class="cu-item arrow" @tap="navTo('money_bag')">
				    				<view class="content">
				    					<text class="cuIcon-moneybag text-orange"></text>
				    					<text class="text-grey">我的钱包</text>
				    				</view>
				    			</view>
				    			 <view class="cu-item arrow" @tap="navTo('coupon_list')">
				    				<view class="content">
				    					<text class="cuIcon-card text-orange"></text>
				    					<text class="text-grey">优惠券</text>
				    				</view>
				    			</view>
				    			<view class="cu-item arrow" @tap="navTo('address_list')">
				    				<view class="content">
				    					<text class="cuIcon-deliver_fill text-brown"></text>
				    					<text class="text-grey">收货地址</text>
				    				</view>
				    			</view>
				    			<view class="cu-item arrow" @tap="telTo">
				    				<view class="content">
				    					<text class="cuIcon-servicefill text-red"></text>
				    					<text class="text-grey">客服反馈</text>
				    				</view>
				    			</view>
				    		</view>
				    		
				    		<view class="cu-list menu sm-border">
				    			<view class="cu-item arrow" @tap="navTo('../setting/index')">
				    				<view class="content">
				    					<text class="lg cuIcon-repairfill text-yellow"></text>
				    					<text class="text-grey">系统设置</text>
				    				</view>
				    			</view>
				    			<view class="cu-item arrow" @tap="navTo('../passport/forget?mobile='+ userInfo.mobile)">
				    				<view class="content">
				    					<text class="cuIcon-lock text-cyan"></text>
				    					<text class="text-grey">修改密码</text>
				    				</view>
				    			</view>
				    			
				    		</view> -->
				
							<!-- 注销退出	 -->
							<!-- <view class="padding flex flex-direction">
				    			<button @tap="gotoLogout" class="cu-btn bg-gradual-green margin-tb-sm lg">注销退出</button>
				    		</view> -->
							<view class="cu-tabbar-height"></view>
						</view>
				
					</view>
				</template>
				
				<script>
					export default {
						name: "my",
						data() {
							return {
								normalScrollView: {},
								orderNav: [{
										icon: "/static/img/ico-dfk.png",
										label: "待付款",
										num: 0,
										status: 0,
										url: "order_list?status=0"
									},
									{
										icon: "/static/img/ico-dfh.png",
										label: "待发货",
										num: 0,
										status: 1,
										url: "order_list?status=1"
									},
									{
										icon: "/static/img/ico-dsh.png",
										label: "待收货",
										num: 0,
										status: 2,
										url: "order_list?status=2"
									},
									{
										icon: "/static/img/ico-sh.png",
										label: "待评价",
										num: 0,
										status: 8,
										url: "order_list?status=3"
									}
								],
								ftNav: [{
										icon: "/static/img/ico-xxgl@2x.png",
										label: "信息管理",
										num: 0,
										status: 8,
										url: "/pages/my/user_info"
									},
									{
										icon: "/static/img/ico-shdz@2x.png",
										label: "收货地址",
										num: 0,
										status: 8,
										url: "/pages/my/address_add"
									},
									{
										icon: "/static/img/ico-yhk@2x.png",
										label: "银行卡",
										num: 0,
										status: 8,
										url: "/pages/my/money_bag"
									},
									{
										icon: "/static/img/ico-jmsq@2x.png",
										label: "加盟申请",
										num: 0,
										status: 8,
										url: ""
									},
									{
										icon: "/static/img/ico-zxkf@2x.png",
										label: "在线客服",
										num: 0,
										status: 8,
										url: ""
									},
									{
										icon: "/static/img/ico-zd@2x.png",
										label: "账单",
										num: 0,
										status: 8,
										url: ""
									},
									{
										icon: "/static/img/ico-fqpt@2x.png",
										label: "发起拼团",
										num: 0,
										status: 8,
										url: ""
									},
									{
										icon: "/static/img/ico-js.png",
										label: "寄售",
										num: 0,
										status: 8,
										url: ""
									},
								]
							};
						},
						methods: {
							navTo(url) {
								//this.hasLogin = true;
								// if(!this.hasLogin){
								// 	url = '/pages/passport/login';
								// }
								uni.navigateTo({
									url
								})
							},
						},
						mounted() {},
						onShow() {
							// let that = this;
							// that.checkLogin();
							// console.log("登录状态",that.hasLogin);
							// if (that.hasLogin){
							// 	that.getUserInfo();
							// }
						},
						onLoad() {},
					};
				</ script>
				
				<style lang="scss" scoped>
					uni-page-body {
						width: 100%;
						height: 100%;
					}
				
					.my {}
				
					.user-top {
						background: url() no-repeat center top;
						background-size: 100%;
						height: 260rpx;
					}
				
					.cu-list.menu>.cu-item .content>uni-text[class*=cuIcon] {
						font-size: 38rpx;
					}
				
					.hy-bg {
						background: url(../../static/img/hy-bj.png) no-repeat;
						background-size: 100% 100%;
					}
				</style>
				
				`
			};
		},
		methods: {
			navTo(url) {
				//this.hasLogin = true;
				// if(!this.hasLogin){
				// 	url = '/pages/passport/login';
				// }
				uni.navigateTo({
					url
				})
			},
		},
		mounted() {},
		onShow() {
			// let that = this;
			// that.checkLogin();
			// console.log("登录状态",that.hasLogin);
			// if (that.hasLogin){
			// 	that.getUserInfo();
			// }
		},
		onLoad() {},
	};
</script>

<style lang="scss" scoped>
	uni-page-body {
		width: 100%;
		height: 100%;
	}

	.my {}

	.user-top {
		background: url() no-repeat center top;
		background-size: 100%;
		height: 260rpx;
	}

	.cu-list.menu>.cu-item .content>uni-text[class*=cuIcon] {
		font-size: 38rpx;
	}

	.hy-bg {
		background: url(../../static/img/hy-bj.png) no-repeat;
		background-size: 100% 100%;
	}
</style>
